<template>
  <div style="height: 66px">
    <div class="base">
      <div class="content">
        <div class="content-left"><a href=""></a></div>
        <div class="content-middle">
          <div class="SearchBox">
            <input
              type="text"
              v-model="value"
              @input="Network"
              placeholder="搜索食谱、菜单"
            />
            <div class="searchBtn">搜菜谱</div>
          </div>
          <div class="xiala" v-if="boole">
            <!-- <div></div> -->
            <div>搜索"{{ value }}"相关用户</div>
            <div>搜索"{{ value }}"相关菜单</div>
          </div>
          <div class="models">
            <a href="/">首页</a>
            <a href="/caidanfenlei">菜谱分类</a>
            <a href="/caidan">菜单</a>
            <a href="/dongtai">作品动态</a>
          </div>
        </div>
        <div class="content-right"><a href=""></a></div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      value: "",
      boole: false,
    };
  },
  methods: {
    Network() {
      if (this.value.length > 0) {
        this.boole = true;
        
        this.$axios({
          url: "http://localhost:8081/zhh/motaisousuo",
          params: {
            titleData: this.value,
          },
        }).then((res)=>{});
      } else {
        this.boole = false;
      }
    },
  },
};
</script>

<style scoped>
.base {
  background-color: white;
  width: 100%;
  border-bottom: 1px solid rgb(243, 243, 243);
  position: fixed;
  top: 0;
  margin-bottom: 15px;
  z-index: 99;
}
.content {
  width: 1000px;
  margin: 10px auto;
  display: flex;
  justify-content: space-between;
}
.content-left a {
  width: 120px;
  height: 40px;
  display: inline-block;
  background-image: url();
}
.content-middle {
  display: flex;
}
.SearchBox {
  display: flex;
}
.searchBtn {
  font-size: 16px;
  color: white;
  background-color: #dd3915;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  width: 79px;
  height: 44px;
}
input {
  width: 280px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid #909191;
}
input:focus {
  outline: none;
}
.models,
.content-right {
  height: 44px;
  line-height: 44px;
}
.models a {
  margin-left: 20px;
}
.models a:hover {
  background-color: #dd3915;
  color: white;
}
.content-right a,
.models a {
  display: inline-block;
  text-decoration: none;
  height: 21px;
  color: #dd3915;
  font-size: 16px;
  text-align: center;
  line-height: 21px;
}
.content-right a:hover {
  background-color: #dd3915;
  color: white;
}
.xiala {
  width: 300px;

  position: fixed;
  top: 54px;
  background-color: white;
}
.xiala div {
  color: #dd3915;
  padding: 0 15px;
  line-height: 30px;
}
.xiala div:hover {
  color: white;
  background-color: #0097cf;
}
</style>